package com.appheader.webfragmentviewpagertest;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


/**
 * A simple {@link Fragment} subclass.
 */
public class WebFragment extends Fragment {

    public WebFragment() {
        // Required empty public constructor
    }



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_web, container, false);
    }

    /**
     *
     * @param s html的url地址
     * @return
     */
    public static Fragment newInstance(String s) {
        WebFragment fragment = new WebFragment();
        Bundle bundle = new Bundle();
        bundle.putString("webUrl", s);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView(view);


    }

    private void initView(View view) {
//        webView = (MyWebView) view.findViewById(R.id.myWebView);
////        webView.getSettings().setPluginsEnabled(true);
//        webView.getSettings().setJavaScriptEnabled(true);
//        webView.getSettings().setSupportMultipleWindows(true);
//        //设置 缓存模式
//        webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
//        // 开启 DOM storage API 功能
//        webView.getSettings().setDomStorageEnabled(true);
    }

//自定义的WebViewClient

}
